package main

import "fmt"

/**
编写一个小程序
给定一个字符串数组
["I","am","stupid","and","weak"]
用 for 循环遍历该数组并修改为
["I","am","smart","and","strong"]
*/
func lesson11() {

	arr1 := [5]string{"I", "am", "stupid", "and", "weak"}
	//"I","am","smart","and","strong"]

	for i := 0; i < len(arr1); i++ {
		//方式一：使用if 进行判断

		//if i == 2 {
		//	arr1[i] = "smart"
		//}
		//if i == 4 {
		//	arr1[i] = "strong"
		//}

		//方式二：使用switch 语句进行判断
		switch i {
		case 2:
			{
				arr1[i] = "smart"
			}
		case 4:
			{
				arr1[i] = "strong"
			}
		}

	}
	fmt.Println(arr1)
}
